package com.coolw.dynamic.thread.pool.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.coolw.common.api.BaseEntity;
import com.coolw.dynamic.thread.pool.enums.KeepAliveTimeUnitEnum;
import com.coolw.dynamic.thread.pool.enums.QueueTypeEnum;
import com.coolw.dynamic.thread.pool.enums.RejectedExecutionHandlerEnum;
import lombok.Getter;
import lombok.Setter;

/**
 * 线程池配置实体类
 *
 * @author coolw
 * @date 2024/5/15 14:35
 */
@Getter
@Setter
@TableName(value = "thread_pool_config")
public class ThreadPoolConfigEntity extends BaseEntity {
    private static final long serialVersionUID = -8742268199720791775L;

    /**
     * 线程池编号
     */
    private String poolNo;

    /**
     * 线程池代码
     */
    private String poolCode;

    /**
     * 线程池名称
     */
    private String poolName;

    /**
     * 核心线程数
     */
    private Integer corePoolSize;

    /**
     * 最大线程数
     */
    private Integer maxPoolSize;

    /**
     * 线程存活时间
     */
    private Long keepAliveTime;

    /**
     * 线程存活时间单位 {@link KeepAliveTimeUnitEnum}
     */
    private String keepAliveTimeUnit;

    /**
     * 队列类型 {@link QueueTypeEnum}
     */
    private String queueType;

    /**
     * 队列大小
     */
    private Integer queueSize;

    /**
     * 拒绝策略 {@link RejectedExecutionHandlerEnum}
     */
    private String rejectStrategy;
}
